Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary use of aria-hidden in the character count #2479

Closed
wants to merge 1 commit into from

Conversation

36degrees
Copy link
Contributor

The govuk-character-count__message--disabled class hides the message using visibility: hidden, so there is no need to also use the aria-hidden attribute.

If an interactive element is hidden using display:none or visibility:hidden (either on the element itself, or any of the element's ancestors), it won't be focusable, and it will also be removed from the accessibility tree. This makes the addition of aria-hidden="true" or explicitly setting tabindex="-1" unnecessary.

https://www.w3.org/TR/using-aria/#4thrule

The `govuk-character-count__message--disabled` hides the message using `visibility: hidden`, so there is no need to also use the `aria-hidden` attribute.

> If an interactive element is hidden using display:none or visibility:hidden (either on the element itself, or any of the element's ancestors), it won't be focusable, and it will also be removed from the accessibility tree. This makes the addition of aria-hidden="true" or explicitly setting tabindex="-1" unnecessary.
>
> https://www.w3.org/TR/using-aria/#4thrule
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2479 December 15, 2021 11:54 Inactive
@36degrees
Copy link
Contributor Author

Everything I've read suggests that nothing will be announced by the live region (as intended) when the element is hidden using visibility: hidden, but I will double check that just in case.

@36degrees 36degrees closed this Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants